#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

char* my_strncpy(char* dest, const char* src,size_t count)
{
	char* ret = dest;
	int i = 0;
	for (i = 0; *src&&i < count; i++)
	{
		*dest++ = *src++;
	}
	if (i < count)
	{
		*dest = 0;
	}
	return ret;
}
int main()
{
	char arr1[10] = { 0 };
	char arr2[] = "hello bit";
	size_t sz = sizeof(arr2);
	my_strncpy(arr1, arr2, sz);
	printf("%s\n", arr1);
	return 0;
}